package com.woniuxy.service.daily.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniuxy.dao.ChargesMapper;

import com.woniuxy.pojo.Charges;
import com.woniuxy.service.daily.ChargesService;
@Service
public class ChargesServiceImpl implements ChargesService {
	@Autowired
	private ChargesMapper chargesMapper;

	@Override
	public PageInfo selectAll(Integer pn, String condition) {
		
		PageHelper.startPage(pn, 5);
		List<Charges> list = chargesMapper.selectAll(condition);
		PageInfo pageInfo = new PageInfo(list, 3);
		return pageInfo;

	}

	@Override
	public void insertSelective(Charges charges) {
		// TODO Auto-generated method stub
		chargesMapper.insertSelective(charges);
	}

	@Override
	public int deleteByPrimaryKey(String cgId) {
		// TODO Auto-generated method stub
		return chargesMapper.deleteByPrimaryKey(cgId);
	}

	@Override
	public Charges selectById(Integer cgId) {
		// TODO Auto-generated method stub
		return chargesMapper.selectByPrimaryKey(cgId);
	}

	@Override
	public int updateCharges(Charges charges) {
		// TODO Auto-generated method stub
		return chargesMapper.updateByPrimaryKeySelective(charges);
	}
}
